import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
 
public class JsonDemo {
    public static void main(String[] args) {
        JSONObject info1 = new JSONObject();
        info1.put("name", "张三");
        info1.put("age", "18");
        JSONObject info2 = new JSONObject();
        info2.put("name", "李四");
        info2.put("age", "19");
        //把上面创建的两个json对象加入到json数组里
        JSONArray array = new JSONArray();
        array.add(info1);
        array.add(info2);
        System.out.println(array);
    }
}